<?php
require './predis/autoload.php';

$opt=array(
	'host'=>'127.0.0.1',
	'port'=>6379
);
$redis=new Predis\Client($opt);

$redis->set('name','张三');

try{
	echo $redis->hget('name');
}catch(Exception $e){
	echo "Message:{$e->getMessage()}";
}

$redis->lpush('numbers','1','2','3','4');

//var_dump($redis->LRANGE('numbers',0,-1));
$result=$redis->LRANGE('numbers',0,-1);
foreach($result as $v){
	echo $v."<br>";
}

?>